home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1999 January - Disc 2
/
Macworld (1999-01) (Disk 2).dmg
/
Serious Demos
/
Symbolic Composer 4.2
/
Environment
/
System
/
CADAR
/
Symbols
/
Other
/
insert-middle-note
< prev
next >
Wrap
Lisp/Scheme
|
1998-10-22
|
2KB
|
31 lines
insert-middle-note melody1 melody2
&optional (type :round) (seed nil)
legal types: :round :rnd :up :down
inserts a new melody between melody1 and melody2
with different rounding-options.
:up equals ceiling
:down equals floor
:round equals round &
:rnd picks randomly among the three (:up :down :round).
:seed sets random-seed only if type is :rnd
(insert-middle-note '(a b c) '(f g h))
-->(c e e)
(insert-middle-note '(a b c) '(f g h) :up)
-->(d e f)
(insert-middle-note '(a b c) '(f g h) :down)
-->(c d e)
(insert-middle-note '(a b c) '(f g h) :rnd 0.1)
-->(d e e)
(setq melo1 (noergaard-infinity-series 89 '(a b)))
(setq melo2 (random-outside (symbol-transpose 12 melo1)
3 :seed 0.1))
(setq melo3 (insert-middle-note melo1 melo2 :round))
(setq melo4 (insert-middle-note melo1 melo3 :rnd 0.1))
(setq melo5 (insert-middle-note melo2 melo3 :rnd 0.3))
(setq chords (mapcar #'compress (mapcar #'list melo1 melo4 melo3 melo5 melo2)))
->(adfik beimq -bcehk cgjmq behkn adhko -cbdgi dhknq -bcgko cgkor adgjl bdgik cfilo -bcgjn -d-bcfi ehkmp beilo acfhk -cbfim dgilo adgjm bfimp -bcehj cehjm -caceh dgknq bdgjm adgjm dgiln -ccfjm -e-cacf fhkmo -bcehk cegil adgkn beimq cehkm -bcgjm -dbehk eimqt adfik beilo -bcfil cegjl bfilo aehko -cbehk dgknq cfjmq -bcehj -dbehk ehknq -bdgjm cfiln adgjm begik -daehl egikn cfilo -bcfil egikn -dadgj -f-cbeh gjmpr bfimp adgjm -cbeil dhkos adgkn beilo -bcegi cehkm -cadgi dgkos begil aeilp dhkor -ccgjn -e-bdgk fjmps acfik behkn -bdgjm cfilo bdgil adgil -cbegj dgjmp -bcgjm)